const path = require('path')

module.exports = {
  publicPath: '/admin/',
  configureWebpack: {
    resolve: { extensions: ['.ts', '.js'] },
    module: {
      rules: [
        {
          // 指定规则
          test: /\.ts$/,
          // 使用的解析器(执行顺序：从后到前)
          use: [{
            loader: 'ts-loader',
            options: {
              transpileOnly: true
            }
          }],
          // 排除的文件夹
          exclude: /node_modules/
        }
      ]
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'scss',
      patterns: [path.resolve(__dirname, 'src/assets/common/global.scss')]
    }
  }
}
